{% extends  data.theme + "/_base.html" %}

{% import "bootstrap/wtf.html" as wtf %}

{% block title %} {{data.title}} {% endblock %}

{%- block head -%} 
{{ super() }}
{%- endblock -%}

{% set form = data.form %}

{%- block body -%}

<div class="col-md-12" >
{% for message in get_flashed_messages() %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{{ message }}
</div>
{% endfor %}

<a href="{{url_for('clips.tag_edit',id=data.tag.id)}}" class="btn btn-default">← Back </a> 
<div class="label label-default">{{data.tag.name}}</div>

<p>
{# basic horizontal form_type="inline" #}
{{ wtf.quick_form(form) }}
</div>

{% endblock %}

-------------------------------------

{% block script %}
{{ super() }}
<script type="text/javascript">
$(function() {
//当前使用的自动form 没有使用
    $('#btn_save').on("click",function(){
        $("#btn_save").attr('disabled',true);
        var form= $("#itemform")[0];
	if(form){
	    //form.pwd2.value = md5(form.pwd2.value);
	    //form.action="{{ url_for('clips.item_edit') }}";
	    form.submit();
	}
        $("#btn_save").attr('disabled',false);
    });
});
</script>
{% endblock %}
